package app.Insam.VNC;

import android.content.BroadcastReceiver;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

public class InsamServiceAutostartBR extends BroadcastReceiver {
	public static final String TAG = "AutoStartBR";
	
	@Override
	public void onReceive(Context _context, Intent _intent) {
	    if(_intent.getAction().equals(Intent.ACTION_BOOT_COMPLETED)) {
	    	ComponentName service = _context.startService(new Intent(_context, InsamService.class));
		    if (null == service){		        // something really wrong here
		        Log.e(TAG, "Could not start service");
		    } else {
		    	Log.d(TAG, "Service Auto Start");
		    }
	    } else {
	      Log.e(TAG, "Received unexpected intent " + _intent.toString());   
	    }
	}
}
